package com.jh.paymentchannel.repository.freeQuick;


import com.jh.paymentchannel.pojo.freeQuick.FreeQuickWithdrawTemp;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface FreeQuickWithdrawTempRepository extends JpaRepository<FreeQuickWithdrawTemp, String>,
        JpaSpecificationExecutor<FreeQuickWithdrawTemp> {

    /**
     * 查询待提现的任务
     * @return
     */
    @Query("select f from FreeQuickWithdrawTemp f where f.payStatus = '0'")
    List<FreeQuickWithdrawTemp> queryWithdrawTemp();

    @Modifying
    @Query("update FreeQuickWithdrawTemp f set f.payStatus = '4' where f.id = ?1")
    void update (int id,String pay_Status);

    FreeQuickWithdrawTemp findByRequestNo(String requestNo);

}
